package org.tacademy.add;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;

public class MyAddActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        Intent intent = getIntent();
        int left = intent.getIntExtra("left", 1);
        int right = intent.getIntExtra("right", 2);
        
        TextView result = (TextView)findViewById(R.id.result);
        result.setText(String.format("%d+%d = %d",left,right,left+right));
    }
}